﻿using HBKY.Shop.Common.LogHelper;
using NLog.Config;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace HBKY.Shop.Extensions
{
    public static class LayoutRenderersExt
    {
        private static Dictionary<string, Type> _layoutRenderers => new Dictionary<string, Type>()
        {
            { "traceId", typeof(TraceIdLayoutRenderer)},
            { "clientip", typeof(ClientIPLayoutRenderer)},
            { "requesturl", typeof(RequestUrlLayoutRenderer)},

        };

        /// <summary>
        /// 注册模版页
        /// </summary>
        public static void  RegisterDefinition()
        { 
            foreach (var item in _layoutRenderers)
            {
               ConfigurationItemFactory
              .Default
              .LayoutRenderers
              .RegisterDefinition(item.Key, item.Value);
            }
        }

    }
}
